package cn.neusoft.service.impl;

import cn.neusoft.domain.Task;
import cn.neusoft.mapper.TaskMapper;
import cn.neusoft.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class TaskServiceImpl implements TaskService {

    @Autowired
    TaskMapper taskMapper;

    @Transactional
    @Override
    public void  add(Task task){
        taskMapper.add(task);
    }

//    @Override
//    @Transactional
//    public List<Task> findByDate() {
//        return null;
//    }

    @Transactional
    @Override
    public List<Task> findByDate(String start,String end){
        return taskMapper.findByDate(start,end);
    }
    @Transactional
    @Override
    public List<Task> findAll() {
        return taskMapper.findAll();
    }

    @Transactional
    @Override
    public List<Task> findByTaskId(String id) {
        return taskMapper.findByTaskId(id);
    }

    @Override
    @Transactional
    public String findFzid(String name) {
        return taskMapper.findFzid(name);
    }

    @Override
    public List<Task> findByfenzhanId(String id) {
        return taskMapper.findByfenzhanId(id);
    }

    @Transactional
    @Override
    public List<Task> findBypostId(String id) {
        return taskMapper.findBypostId(id);
    }

    @Transactional
    @Override
    public List<Task> findByrName(String name) {
        return taskMapper.findByrName(name);
    }

    @Transactional
    @Override
    public List<Task> findByStatus(String status) {
        return taskMapper.findByStatus(status);
    }

    @Transactional
    @Override
    public List<Task> findByType(String type) {
        return taskMapper.findByType(type);
    }

    @Override
    @Transactional
    public void sgDiaodu(Task task) {
        taskMapper.sgDiaodu(task);
    }

    @Override
    public String getUnit(String productName) {
        return taskMapper.getUnit(productName);
    }

    @Override
    public Integer getCharge(String fenzhanID) {
        return taskMapper.getCharge(fenzhanID);
    }

    @Override
    public Integer getEctTime(String fenzhanID) {
        return taskMapper.getEctTime(fenzhanID);
    }

    @Override
    public void setPostman(String taskId, String personId) {
        taskMapper.setPostman(taskId,personId);
    }


}
